package com.chinanet.oracle.service;

import com.chinanet.oracle.entry.OModel;
import com.chinanet.oracle.repository.OModelRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

@Service("oModelService")
public class OModelService {
    @Autowired
    private OModelRepository modelRepository;

    public Iterable<OModel> findAll(){
        return modelRepository.findAll();
    }


    public Iterable<OModel> findHistory(BigDecimal aim){
        return modelRepository.findHistory(aim);
    }

    public OModel findById(@Param("PID") int pid){
        return modelRepository.findById(pid);
    }
}